#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File     : __init__.py
@Project  : dev
@Date     : 2021/12/5
@Author   : Zhang Jinyang
@Contact  : zhang-jy@sjtu.edu.cn
'''
 
import time
import logging
import os
import time

logger = logging.getLogger("executor")
logger.setLevel(logging.INFO)

rf_handler = logging.StreamHandler()  # 默认是sys.stderr
# rf_handler.setFormatter(logging.Formatter("%(asctime)s - %(message)s\n"))
rf_handler.setLevel(logging.INFO)


dir = './log/'
if not os.path.exists(dir):
    os.mkdir(dir)


f_handler = logging.FileHandler(dir+f'/executor_{time.time()}.log')
# f_handler.setFormatter(logging.Formatter("%(asctime)s - %(message)s\n"))
f_handler.setLevel(logging.INFO)

logger.addHandler(rf_handler)
logger.addHandler(f_handler)